﻿using Lamex.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Lamex.SystemManager.Model
{
    [DataContract]
    [KnownType("GetKnowTypes")]
    [Serializable]
    [Table(TableName = "Sys_Function", KeyName = "ID", OutoKeyValue = "ID", sortIndex = "CreateDate")]
    public  class Sys_FunctionInfo
    {
        string _ID ;
        string _PID = "";
        string _FunName = "";
        string _FunControlID = "";
        string _SystemType = "";
        string _SortCode = "";
        string _IsVaild = "";
        string _UserID = "";
        string _UserName = "";
        string _CreateBy = "";
        DateTime _CreateDate ;
        string _SysMenu="";
        string _EngName = "";
        /// <summary>
        /// 主键ID
        /// </summary>
        [DataMember]
        public string ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        /// <summary>
        /// PID
        /// </summary>
        [DataMember]
        public string PID
        {
            get { return _PID; }
            set { _PID = value; }
        }

         /// <summary>
        /// 功能名称
        /// </summary>
        [DataMember]
        public string FunName
        {
            get { return _FunName; }
            set { _FunName = value; }
        }
        
        /// <summary>
        /// 功能ID
        /// </summary>
        [DataMember]
        public string FunControlID
        {
            get { return _FunControlID; }
            set { _FunControlID = value; }
        }

        /// <summary>
        /// 类据类型
        /// </summary>
        [DataMember]
        public string SystemType
        {
            get { return _SystemType; }
            set { _SystemType = value; }
        }
        /// <summary>
        /// 排序
        /// </summary>
        [DataMember]
        public string SortCode
        {
            get { return _SortCode; }
            set { _SortCode = value; }
        }
      
        /// <summary>
        /// 
        /// </summary>
        [DataMember]
        public string IsVaild
        {
            get { return _IsVaild; }
            set { _IsVaild = value; }
        }
        /// <summary>
        /// 用户ID
        /// </summary>
        [DataMember]
        public string UserID
        {
            get { return _UserID; }
            set { _UserID = value; }
        }
        /// <summary>
        /// 用户名称
        /// </summary>
        [DataMember]
        public string UserName
        {
            get { return _UserName; }
            set { _UserName = value; }
        }

        /// <summary>
        /// 创建人
        /// </summary>
        [DataMember]
        public string CreateBy
        {
            get { return _CreateBy; }
            set { _CreateBy = value; }
        }
        /// <summary>
        /// 创建时间
        /// </summary>
        [DataMember]
        public DateTime CreateDate
        {
            get { return _CreateDate; }
            set { _CreateDate = value; }
        }
        [DataMember]
        public string SysMenu
        {
            get { return _SysMenu; }
            set { _SysMenu = value; }
        }
        [DataMember]
        public string EngName
        {
            get { return _EngName; }
            set { _EngName = value; }
        }
        
    }

    /// <summary>
    /// 系统功能节点对象
    /// </summary>
    [Serializable]
    [DataContract]
    public class SysFunctionNodeInfo : Sys_FunctionInfo
    {
        private List<SysFunctionNodeInfo> m_Children = new List<SysFunctionNodeInfo>();

        /// <summary>
        /// 子菜单实体类对象集合
        /// </summary>
        [DataMember]
        public List<SysFunctionNodeInfo> Children
        {
            get { return m_Children; }
            set { m_Children = value; }
        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        public SysFunctionNodeInfo()
        {
            this.m_Children = new List<SysFunctionNodeInfo>();
        }

        /// <summary>
        /// 参数构造函数
        /// </summary>
        /// <param name="functionInfo">FunctionInfo对象</param>
        public SysFunctionNodeInfo(Sys_FunctionInfo functionInfo)
        {
            base.FunControlID = functionInfo.FunControlID;
            base.ID = functionInfo.ID;
            base.FunName = functionInfo.FunName;
            base.PID = functionInfo.PID;
            base.SystemType = functionInfo.SystemType;
            base.SortCode = functionInfo.SortCode;
            base.EngName = functionInfo.EngName;
        }
    }
}
